from selenium.webdriver import ActionChains
from selenium import webdriver
import time


driver = webdriver.Chrome()
driver.maximize_window()

driver.get(url='https://www.baidu.com/')

# 2.定位到要悬停的元素
element = driver.find_element_by_xpath('//*[@id="s-usersetting-top"]')

# 3.对定位到的元素执行鼠标悬停操作
ActionChains(driver).move_to_element(to_element=element).perform()

time.sleep(1)

driver.find_element_by_link_text('高级搜索').click()

time.sleep(10)

driver.quit()